Skip to content

Conversation

@arkjedrz
Copy link
Contributor

mw_log backend implementation using baselibs.

@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

@arkjedrz arkjedrz requested a review from vinodreddy-g January 5, 2026 09:18
@arkjedrz arkjedrz force-pushed the arkjedrz_mw-log branch 2 times, most recently from 93febff to 8ff01eb Compare January 6, 2026 09:17
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 954c6e04-81e4-4fe4-964a-6184204ef546
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rust_qnx8_toolchain+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-eQOopREOYCL5vtTb6c1cwZrql4GVrJ1FqgxarQRe1xs="
DEBUG: Repository rust_qnx8_toolchain+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.4.1, but got rules_python@1.5.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.8 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@1.10.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.2.0.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.17.0.bcr.1, but got googletest@1.17.0.bcr.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 21.885s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@arkjedrz arkjedrz temporarily deployed to workflow-approval January 6, 2026 13:43 — with GitHub Actions Inactive
@arkjedrz arkjedrz marked this pull request as ready for review January 6, 2026 13:53
@arkjedrz arkjedrz temporarily deployed to workflow-approval January 7, 2026 10:09 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval January 7, 2026 13:41 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval January 12, 2026 13:14 — with GitHub Actions Inactive
@arkjedrz arkjedrz self-assigned this Jan 14, 2026
@arkjedrz arkjedrz marked this pull request as draft January 15, 2026 07:28
@arkjedrz arkjedrz temporarily deployed to workflow-approval January 16, 2026 13:25 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval January 19, 2026 08:25 — with GitHub Actions Inactive
@arkjedrz arkjedrz marked this pull request as ready for review January 19, 2026 09:07
@arkjedrz arkjedrz requested a review from rmaddikery January 19, 2026 09:07
@arkjedrz
Copy link
Contributor Author

Source code is ready, renames to be done.

`mw_log` backend implementation using `baselibs`.

trace!("This is a trace log - hidden");
debug!("This is a debug log - hidden");
error!("This is an error log");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing usage with constext on default logger

if (logger->IsLogEnabled(current)) {
return current;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoppe-and-dreams dont we have some API to just check it instead of manually resolving it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Copy data into array.
let mut data: [c_char; 4] = [0; 4];
unsafe {
core::ptr::copy_nonoverlapping(context.as_ptr(), data.as_mut_ptr() as *mut u8, size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cast<>() instead as


impl Recorder {
pub fn new() -> Self {
let inner = unsafe { recorder_get() };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

caling C FFi shall do ptr checking. So check nullptrs ie with debug_assert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do, but why debug_assert and not assert?

if let Some(ref path) = self.config_path {
let path_os_str = path.as_os_str();
if !path_os_str.is_empty() {
unsafe { set_var(KEY, path_os_str) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add #safety caluse to all unsafe stuff in this pr

// Create log stream.
let context = metadata.context();
let log_level = metadata.level().into();
let log_stream = LogStream::new(&self.recorder, context, log_level);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as writen before, if internals of this failed, we can jsut skip logging here.

}

// SAFETY: The underlying C++ logger is known to be thread-safe.
unsafe impl Send for ScoreLogger {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C++ ffi types shall have sync/send markups

/// [`score_log::fmt::ScoreWrite`] writer implementation used by [`crate::ScoreLogger`].
/// Adds values to the log stream with selected formatting.
pub(crate) struct ScoreLoggerWriter<'a> {
log_stream: LogStream<'a>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw why not implement ScoreWrite over LogStream and doing next class here ?

Self { recorder, slot }
}

pub fn log_bool(&mut self, v: &bool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all those with inline hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants